<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class StoreCart extends Model
{
    use HasFactory;

    protected $table = "store_cart";

    protected $guarded = [];
    public $timestamps = false;

    public static function CartAdd($data)
    {
        return DB::table('store_cart')->insert($data);
    }

    public static function CartDelete($id)
    {
        return DB::table('store_cart')->where('id', $id)->update(['is_del' => 1]);
    }

    public static function CartUpdate($id, $data)
    {
        return DB::table('store_cart')->where('id', $id)->update($data);
    }

}
